package top.gcl.controller;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import top.gcl.entity.Goods;
import top.gcl.entity.User;
import top.gcl.madel.JsonResult;
import top.gcl.service.UserSrvImpl;


import javax.annotation.Resource;

@RestController
public class UserCtrl {

    @Resource
    private UserSrvImpl srv;
    @PostMapping("/login/{username}/{password}")
    public JsonResult<User> queryByUsername(@PathVariable("username") String username , @PathVariable("password") String password){
        User user=srv.queryByUsername(username,password);
        JsonResult res=new JsonResult(520,"♥登录成功♥");
        res.setData(user);
        return res;

    }
}
